﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

namespace Rio.Framework.Pages.ModalControls
{
    public partial class ModalDialog : UserControl
    {
        public Double ApplicationWidth
        {
            get { return (Double)GetValue(ApplicationWidthProperty); }
            set { SetValue(ApplicationWidthProperty, value); }
        }
        public static readonly DependencyProperty ApplicationWidthProperty =
            DependencyProperty.Register("ApplicationWidth", typeof(Double), typeof(ModalDialog), null);

        public Double ApplicationHeight
        {
            get { return (Double)GetValue(ApplicationHeightProperty); }
            set { SetValue(ApplicationHeightProperty, value); }
        }
        public static readonly DependencyProperty ApplicationHeightProperty =
            DependencyProperty.Register("ApplicationHeight", typeof(Double), typeof(ModalDialog), null);

        public ModalDialog()
        {
            InitializeComponent();

            this.TabNavigation = KeyboardNavigationMode.Local;
            this.Width = ApplicationWidth;
            this.Height = ApplicationHeight;
        }

        public void AddControl(UserControl userControl)
        {
            this.LayoutRoot.Children.Add(userControl);
        }

        public void ClearControl()
        {
            this.LayoutRoot.Children.Clear();
        }
    }
}
